package ${packageName};

<#if applicationPackage??>
import ${applicationPackage}.R;
import ${applicationPackage}.BR;
<#if isStronglyType>
import ${applicationPackage}.databinding.${activityClass}Binding;
</#if>
</#if>
<#if !isStronglyType>
import android.databinding.BaseObservable;
import android.databinding.ViewDataBinding;
</#if>
import <#if applicationPackage??>${applicationPackage}.</#if>model.viewModel.${viewModelClass};

<#if isGenerateIView>
import <#if applicationPackage??>${applicationPackage}.</#if>model.viewModel.interfaces.${iViewName};
</#if>

import com.jone.base.ui.BindingBaseActivity;

/**
 *  ${activityDescribe}
 */
public class ${activityClass} extends BindingBaseActivity<#if isStronglyType><${viewModelClass}, ${activityClass}Binding></#if><#if isGenerateIView> implements ${iViewName}</#if> {

    <#if !hasTitle>
     @Override
    protected boolean hasTitle() {
        return false;
    }
    </#if>

    @Override
    protected int layoutResId() {
        return R.layout.${layoutName};
    }

    @Override
    protected <#if isStronglyType>${viewModelClass}<#else>BaseObservable</#if> onCreateViewModel() {
        return  new ${viewModelClass}(<#if isGenerateIView>this</#if>);
    }

    @Override
    protected void setVariable(<#if isStronglyType>${activityClass}Binding binding, ${viewModelClass} viewModel<#else>ViewDataBinding binding, BaseObservable viewModel</#if>) {
        <#if hasTitle>
        setTitle(getString(R.string.title_${activityClass}));
        </#if>

        binding.setVariable(BR.viewModel, viewModel);

    }
}
